home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / sharewar / FFE / GRAPH.SWG / 0028_XBM - X Bitmap Format.pas < prev    next >
Pascal/Delphi Source File  |  1997-05-11  |  2KB  |  74 lines

  1. Subj : XBM
  2. Keys : XBM,UNIX,LINUX,XWINDOW,BSD,FILE,FORMAT
  3.  
  4. XBM - X BitMap Format
  5.  
  6. XBM  is  a  native file format of The  X  Window  System and is used for
  7. storing  cursor  and icon bitmaps that are  used in the X GUI. XBM files
  8. are  quite  different in that they  are actually C language source files
  9. that  are  created  to be read by  a  C compiler rather than a graphical
  10. display program.
  11.  
  12. XBM  data  is typically found in headers  (.h files) and are a series of
  13. static  unsigned char arrays containing the monochrome pixel data. There
  14. is one array per image stored in the header.
  15.  
  16. As an example, the following piece of C code is an X BitMap file:
  17.  
  18.   #define test_width 16
  19.   #define test_height 16
  20.   static unsigned char test_bits[] = {
  21.      0xff, 0xff, 0x01, 0x80, 0xfd, 0xbf, 0x05, 0xa0, 0xf5, 0xaf, 0x15, 0xa8,
  22.      0xd5, 0xab, 0x55, 0xaa, 0x55, 0xaa, 0xd5, 0xab, 0x15, 0xa8, 0xf5, 0xaf,
  23.      0x05, 0xa0, 0xfd, 0xbf, 0x01, 0x80, 0xff, 0xff};
  24.  
  25. Which defines the 16x16 bitmap that looks like:
  26.  
  27.         ################
  28.         #              #
  29.         # ############ #
  30.         # #          # #
  31.         # # ######## # #
  32.         # # #      # # #
  33.         # # # #### # # #
  34.         # # # #  # # # #
  35.         # # # #  # # # #
  36.         # # # #### # # #
  37.         # # #      # # #
  38.         # # ######## # #
  39.         # #          # #
  40.         # ############ #
  41.         #              #
  42.         ################
  43.  
  44. -----------
  45. XBM  was  created  by the X Consortium  as  part of the X Window System.
  46. Refer  to  the  /bitmaps  directory of  the  X  Window  distribution for
  47. examples  of XBM files. The central  FTP distribution site for X version
  48. 11 is:
  49.  
  50.   ftp://ftp.x.org
  51.  
  52. Reference works describing XBM include:
  53.  
  54. - Xlib-C language X Interface, Gettys, James, and Robert W. Scheiffler,
  55.   Consortium Standard, X Version 11, Release 5, First Revision, August 1991.
  56.  
  57. - Xlib Programming Manual, Nye, Adrian, third edition, O'Reilly & Associates,
  58.   Inc. Sebastopol, CA, 1992.
  59.  
  60. -----------
  61. Remember, at Unix EOL (End of Line) is "0A" (LF/Line Feed), but in a DOS
  62. compatible system, EOL is "0D 0A" (CR+LF/Carriage Return+Line Feed).
  63.  
  64. Eduardo Motta Buhrnheim (Mingo)
  65. mingo@n3.com.br
  66. P.O.Box, 3159,
  67. Manaus, Amazonas,
  68. Brazil, 69001-970.
  69.  
  70. EXTENSIONS: XBM
  71. OCCURENCES: PC,SUN
  72. PROGRAMS: X WINDOW SYSTEM,UNIX,INTERNET BROWSERS
  73.  
  74.